home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 19 / Amiga Format CD19 (1997-10-02)(Future Publishing)(GB)(Track 1 of 5)[!][issue 1997-11].iso / -seriously_amiga- / shareware / comms / other / yamexpansion / yamexp.rexx < prev    next >
OS/2 REXX Batch file  |  1997-08-18  |  37KB  |  1,152 lines

  1. /* ---------------------------------------------------------------- */
  2. /*                                                                  */
  3. /*                           YAM-Expansion v1.6                     */
  4. /*                                                                  */
  5. /*                   (C) 1997 by Diego 'dxo' de Felice              */
  6. /*                                                                  */
  7. /*                                                                  */
  8. /*  this program is freeware, but you cannot use the whole code or  */
  9. /*                   a part of it in your programs.                 */
  10. /* ---------------------------------------------------------------- */
  11.  
  12. options results
  13. didi=''
  14. dido=''
  15.  
  16. parse arg didi dido
  17.  
  18. NoNotifySet = 0x8042216f
  19. Application_AboutMUI = 0x8042d21d
  20. Application_OpenConfigWindow = 0x804299ba
  21.  
  22. Draggable = 0x80420b6e
  23. Listview_DragType = 0x80425cd3
  24. List_Format =                     0x80423c0a
  25. Weight =                          0x80421d1f
  26. Numeric_Value = 0x8042ae3a
  27. Menuitem_Title = 0x804218be
  28. Menuitem_Shortcut =               0x80422030
  29. Boopsi_MinHeight =                0x80422c93
  30. Boopsi_MinWidth =                 0x80428fb2
  31. Boopsi_Remember =                 0x8042f4bd
  32. Boopsi_TagScreen =                0x8042bc71
  33.  
  34. TRUE = 1
  35. FALSE = 0
  36. Listview_DragType_None = 0
  37. Listview_DragType_Immediate = 1
  38. Frame_None = 0
  39. Frame_Text = 3
  40. TriggerValue = 0x49893131
  41. EveryTime = 0x49893131
  42.  
  43. MUIA_List_AutoVisible = 0x8042a445
  44. MUIA_List_Format = 0x80423c0a
  45. MUIA_List_DragSortable =    0x80426099
  46. List_Remove = 0x8042647e
  47.  
  48. MUIA_List_Active =          0x8042391c
  49. MUIA_List_Insert_Bottom = -3
  50. MUIV_List_Remove_Active = -1
  51. MUIA_List_Entries =         0x80421654
  52. MUIM_List_Redraw = 0x80427993
  53. MUIM_List_Clear = 0x8042ad89
  54. List_GetEntry = 0x804280ec
  55.  
  56. Draggable = '0x80420b6e'
  57. Dirlist_RejectIcons = '0x80424808'
  58. Listview_DragType = '0x80425cd3'
  59. Listview_MultiSelect = '0x80427e08'
  60. Menuitem_Title = '0x804218be'
  61. Weight = '0x80421d1f'
  62. ShowMe = '0x80429ba8'
  63.  
  64. MUIA_Window_PublicScreen =  0x804278e4
  65. MUIA_List_Format =                     0x80423c0a
  66. MUIA_List_Entries =                    0x80421654
  67. MUIA_String_Contents = 0x80428ffd
  68. MUIA_Group_SameHeight = 0x80428ffd
  69. MUIV_List_Insert_Sorted = -2
  70. MUIV_List_Active_Off = -1
  71.  
  72. MUIM_List_Clear = 0x8042ad89
  73. MUIA_List_Active =          0x8042391c
  74. MUIM_List_GetEntry =        0x804280ec
  75.  
  76. selected= 0x8042654b
  77.  
  78. askb0='Are you sure you want to modify'
  79. askb1='email ?'
  80. suff0='a Sent'
  81. suff1='an Incoming'
  82. suff2='an Archived'
  83. portazze=show('P') || ' '
  84.  
  85. frommo='Aminet mailing list maintainer <aminetd@wuarchive.wustl.edu>'
  86. giornal="Today's Aminet uploads on"
  87. settima="This week's Aminet uploads on"
  88. error1='This is not an Aminet-mailing-list email !!!'
  89. primadeifili ='|----------------- ---        ---- -----------'
  90. primadeifilis='|----------------- ---        ---- --- -----------'
  91. msgday='Message of the day:'
  92. msgmir='MIRROR STATUS:'
  93.  
  94. statino=' Ready to serve you...'
  95. statinozzo='Yam-Expansion v1.4 by Dx0. Contact me at:d.defelice@ba.nettuno.it'
  96.  
  97. address YAMEXP
  98.  
  99. select
  100.  
  101.  when didi='RIMOZZO' then call removazzo
  102.  when didi='MAKOZZO' then call makkolo
  103.  when didi='FOKOZZO' then call fokkolo
  104.  when didi='WRL' then call ritodrl
  105.  when didi='WCH' then call riwekch
  106.  when didi='WMD' then call riwekmd
  107.  when didi='ADALL' then call selezionazzi
  108.  when didi='FF' then call faiftp
  109.  when didi='XIXI' then address YAMEXP window ID cicciotto CLOSE
  110.  
  111.  when didi='' then do
  112.                    if find(portazze,'YAM')=0 then
  113.                       do
  114.                       window ID DOZE COMMAND PORT YAMExp TITLE "Error Message"
  115.                              group
  116.                              label CENTER "Please start Yam first !!!"
  117.                              button ID ERR COMMAND '"quit"' PORT YAMEXP LABEL "Ok I'll do it"
  118.                              endgroup
  119.                       endwindow
  120.                       exit
  121.                       end
  122.                    call conamiga
  123.                    call faiwindoze
  124.                    end
  125.  
  126.  when didi='HTMLL' then call htmlla
  127.  when didi='AGGI' then call aggiftpmail
  128.  
  129.  when didi='RASSALO' then do
  130.                           tipozzolo=3
  131.                           call ransignalo
  132.                           end
  133.  
  134.  when didi='RASGALO' then do
  135.                           tipozzolo=1
  136.                           call ransignalo
  137.                           end
  138.  
  139.  when didi='RASTALO' then do
  140.                           tipozzolo=2
  141.                           call ransignalo
  142.                           end
  143.  
  144.  when didi='SALVAGALO' then do
  145.                             ftpmailsites=word(dido,1)
  146.                             aminethtmlsites=word(dido,2)
  147.                             aminetftpsites=word(dido,3)
  148.                             call salvaamiga
  149.                             window ID WINDOZE CLOSE
  150.                             call faiwindoze
  151.                             end
  152.  
  153.  when didi='FICCALA' then do
  154.                           ftpmailsites=word(dido,1)
  155.                           aminethtmlsites=word(dido,2)
  156.                           aminetftpsites=word(dido,3)
  157.                           call amigala
  158.                           window ID WINDOZE CLOSE
  159.                           call faiwindoze
  160.                           end
  161.  otherwise nop
  162.  
  163. end
  164.  
  165. exit
  166.  
  167. /* ---------------------< Funzioni >-------------------------------------------------------------------------------------------------------------------- */
  168.  
  169. faiwindoze:
  170.  
  171. window ID WINDOZE COMMAND "quit" PORT YAMExp TITLE "YAM-Expansion v1.0 (by dx0)"
  172.  
  173.  group ID MMM REGISTER PORT YAMExp LABELS "Main,Configuration"
  174.  
  175.   group
  176.  
  177. if feffone=1 then do
  178.                   group ID AMI1 FRAME LABELS "Aminet"
  179.                     button ID AMINETTER COMMAND '"YAMExp.rexx HTMLL"' HELP '"Create an html file from an Aminet recent email"' LABEL "Make Recent-HTML"
  180.                     button ID FTPIT COMMAND '"YAMExp.rexx FF"' HELP '"Create a ftpmail or an AmFtp batch file from an Aminet recent email"' LABEL "Ftp Section"
  181.                   endgroup
  182.                   end
  183.  
  184. if sfeffeo=1 then do
  185.                   group ID SISSI FRAME LABELS "Sign"
  186.                     button ID RASI COMMAND '"YAMExp.rexx RASSALO"' HELP '"Sign the selected email with a random sign"' LABEL "Random Sign"
  187.                     button ID RANSSIGN COMMAND '"YAMExp.rexx RASGALO"' HELP '"Sign the selected email with a serious sign"' LABEL "Serious Sign"
  188.                     button ID RANNSIGN COMMAND '"YAMExp.rexx RASTALO"' HELP '"Sign the selected email with an informal sign"' LABEL "Informal Sign"
  189.                   endgroup
  190.                   end
  191.  
  192. if pappone=1 then do
  193.                   button ID ABO COMMAND '"text ID STATUS LABEL  Yam-Expansion v1.0 by Dx0"' PORT YAMEXP ICON "yamexpansion:data/icon"
  194.                   end
  195.  
  196.   endgroup
  197.  
  198.   cantatu=ftpmailsites aminethtmlsites aminetftpsites
  199.  
  200.   group
  201.  
  202.     group FRAME LABELS "Aminet"
  203.  
  204.       group HORIZ
  205.         label CENTER "Ftpmail Url:"
  206.         poplist ID SFTP COMMAND '"YAMExp.rexx AGGI 'cantatu'"' HELP '"Select the ftpmail URL"' LABELS ftpmailsites CONTENT ftpmailurl
  207.       endgroup
  208.  
  209.       group HORIZ
  210.         label CENTER "HTML Aminet Url:"
  211.         poplist ID FTPLINK COMMAND '"YAMExp.rexx AGGI 'cantatu'"' HELP '"Select the Html Aminet Url"' LABELS aminethtmlsites CONTENT amineturl
  212.       endgroup
  213.  
  214.       group HORIZ
  215.         label CENTER "Aminet Ftp Url:"
  216.         poplist ID FTPP COMMAND '"YAMExp.rexx AGGI 'cantatu'"' HELP '"Select the Ftp Aminet Url"' LABELS aminetftpsites CONTENT ftpsitu
  217.       endgroup
  218.  
  219.       group HORIZ
  220.         label CENTER "Aminet Dir:"
  221.         string ID DIRRA HELP '"Enter the directory that holds Aminet"' CONTENT aminetdir
  222.       endgroup
  223.  
  224.       group HORIZ
  225.         label CENTER "AmFtp Batch File:"
  226.         popasl ID BACIO HELP '"Enter the file name for the AmFtp batch file"' CONTENT batchfile
  227.       endgroup
  228.  
  229.       group HORIZ
  230.         check ID FB ATTRS selected baffone
  231.         label CENTER "append entries to batch file"
  232.       endgroup
  233.  
  234.     endgroup
  235.  
  236.     group FRAME LABELS "Signs"
  237.  
  238.       group HORIZ
  239.         label CENTER "Serious Sign:"
  240.         popasl ID SERSIGN HELP '"Select the serious signature file"' CONTENT seriaccio
  241.       endgroup
  242.  
  243.       group HORIZ
  244.         label CENTER "Informal Sign:"
  245.         popasl ID INFSIGN HELP '"Select the informal signature file"' CONTENT gaglioffo
  246.       endgroup
  247.  
  248.     endgroup
  249.  
  250.     group FRAME LABELS "Various"
  251.  
  252.       group HORIZ
  253.         check ID SWIAM ATTRS selected feffone
  254.         label CENTER "turn on the Aminet functions"
  255.       endgroup
  256.  
  257.       group HORIZ
  258.         check ID SWISI ATTRS selected sfeffeo
  259.         label CENTER "turn on signatures functions"
  260.       endgroup
  261.  
  262.       group HORIZ
  263.         check ID ICOC ATTRS selected pappone
  264.         label CENTER "turn on YamExpansion logo"
  265.       endgroup
  266.  
  267.     endgroup
  268.  
  269.     group HORIZ
  270.      button ID USAI COMMAND '"yamexp.rexx FICCALA 'cantatu'"' LABEL "Use"
  271.      button ID SAVAI COMMAND '"yamexp.rexx SALVAGALO 'cantatu'"' LABEL "Save"
  272.     endgroup
  273.  
  274.   endgroup
  275.  
  276.  endgroup
  277.  
  278.  text ID STATUS LABEL statino
  279.  
  280. endwindow
  281.  
  282. return
  283.  
  284. /* ---------------------------------------------------------------- */
  285.  
  286. aggiftpmail:
  287.  
  288. ftpmailsites=word(dido,1)
  289. aminethtmlsites=word(dido,2)
  290. aminetftpsites=word(dido,3)
  291.  
  292. address YAMEXP poplist ID SFTP
  293. gingilli=result
  294. if pos(gingilli,ftpmailsites)=0 then do
  295.                                      ftpmailsites=gingilli||','||ftpmailsites
  296.                                      end
  297.  
  298. address YAMEXP poplist ID FTPP
  299. gingillis=result
  300. if pos(gingillis,aminetftpsites)=0 then do
  301.                                         aminetftpsites=gingillis||','||aminetftpsites
  302.                                         end
  303.  
  304. address YAMEXP poplist ID FTPLINK
  305. gingillia=result
  306. if pos(gingillia,aminethtmlsites)=0 then do
  307.                                          aminethtmlsites=gingillia||','||aminethtmlsites
  308.                                          end
  309. call amigala
  310. window ID WINDOZE CLOSE
  311. call faiwindoze
  312. return
  313.  
  314. ransignalo:
  315.  
  316. addlib('rexxsupport.library',0,-30)
  317.  
  318. statino=' Signing your email...'
  319. address YAMEXP text ID STATUS LABEL statino
  320.  
  321. address 'YAM'
  322.  
  323. getfolderinfo NUMBER
  324. zainetto=result
  325.  
  326. select
  327.  
  328. when zainetto=0 then do
  329.                      'request "'askb0 suff1 askb1'" "_Yes I want|_No sorry"'
  330.                      if result=0 then exit end
  331.                      end
  332.  
  333. when zainetto=2 then do
  334.                      'request "'askb0 suff0 askb1'" "_Yes I want|_No sorry"'
  335.                      if result=0 then exit end
  336.                      end
  337.  
  338. when zainetto>2 then do
  339.                      'request "'askb0 suff2 askb1'" "_Yes I want|_No sorry"'
  340.                      if result=0 then exit end
  341.                      end
  342. otherwise nop
  343. end
  344.  
  345. select
  346.  
  347.   when tipozzolo=1 then do
  348.                         address YAMEXP popasl ID SERSIGN
  349.                         figoccio=result
  350.                         end
  351.  
  352.   when tipozzolo=2 then do
  353.                         address YAMEXP popasl ID INFSIGN
  354.                         figoccio=result
  355.                         end
  356.  
  357.   when tipozzolo=3 then do
  358.                         listarande=SHOWDIR('yamexpansion:ransigns','FILE',' ')
  359.                         mutrande=words(listarande)                  /* File random da appendere */
  360.                         randa=random(1,mutrande,time(s))
  361.                         figoccio='yamexpansion:ransigns/' || word(listarande,randa)
  362.                         end
  363.   otherwise nop
  364.  
  365. end
  366.  
  367. call open(luvi,figoccio,'R')
  368.  
  369. getmailinfo file                         /* File a cui appendere */
  370. call open(infamona,result,'A')
  371.  
  372. writeln(infamona,'--')
  373. writeln(infamona,'')
  374.  
  375. do until EOF(luvi)                           /* Riempe l'email */
  376.          limazzaza=readln(luvi)
  377.          writeln(infamona,limazzaza)
  378. end
  379.  
  380. call close(infamona)                            /* Chiusura dei file */
  381. call close(luvi)
  382. mailupdate
  383.  
  384. statino=' Operation done, ready to serve you...'
  385. address YAMEXP text ID STATUS LABEL statino
  386.  
  387. return
  388.  
  389. /* ---------------------------------------------------------------- */
  390.  
  391. htmlla:
  392.  
  393. statino=' Making your html file...'
  394. address YAMEXP text ID STATUS LABEL statino
  395.  
  396. address 'YAM'
  397.  
  398. getmailinfo from
  399. vediamo=compare(result,frommo)
  400.  
  401. if vediamo~=0 then do
  402.                    'request "'error1'" "_Oh sorry"'
  403.                    exit
  404.                    end
  405. else
  406.  
  407. do
  408.  
  409. getmailinfo sub
  410. eccolo=result
  411.  
  412. getmailinfo file
  413. call open(carmela,result,'R')
  414.  
  415. if find(eccolo,giornal) then do
  416.                              flaggo=0
  417.                              call creafile('Daily.')
  418.                              call titola(eccolo)
  419.                              call tavolozza(primadeifili)
  420.                              call ilresto
  421.                              call chiudihtml(filo)
  422.                              call close(carmela)
  423.                              end
  424.  
  425. if find(eccolo,settima) then do
  426.                              flaggo=1
  427.                              call creafile('Weekly.')
  428.                              call titola(eccolo)
  429.                              call tavolozza(primadeifili)
  430.                              call chiudihtml(filo)
  431.  
  432.                              flaggo=2
  433.                              call creafile('MostDL.')
  434.                              titolomost='The most downloaded files from Aminet during the week until ' || daten
  435.                              call titola(titolomost)
  436.                              call tavolozza(primadeifilis)
  437.                              call chiudihtml(filo)
  438.  
  439.                              call creafile('Charts.')
  440.                              titolochart='The highest rated programs during the week until ' || daten
  441.                              call titola(titolochart)
  442.                              call tavolozza(primadeifilis)
  443.                              call ilresto
  444.                              call chiudihtml(filo)
  445.  
  446.                              call close(carmela)
  447.                              end
  448.  
  449. address 'YAM'
  450.  
  451. portazze=show('P') || ' '
  452.  
  453. if pos('VOYAGER',portazze)=0 & pos('IBROWSE',portazze)=0 & pos('AWEB',portazze)=0 & pos('MINDWALKER',portazze)=0 then
  454.  
  455.   do
  456.   if flaggo=0 then do
  457.                    risultati='The file containing the list of files was named: ' nome
  458.                    'request "'risultati'" "_Oh Thanks"'
  459.                    end
  460.   if flaggo>0 then do
  461.                    risultati='The files were named: yamexpansion:html/Weekly.' || daten || '.html, yamexpansion:html/MostDL.' || daten || '.html, Yamexpansion:html/Chart.' || daten || '.html'
  462.                    'request "'risultati'" "_Oh Thanks"'
  463.                    end
  464.   end
  465.  
  466. else do
  467.      if flaggo=0 then call sballa(nome)
  468.      if flaggo>0 then do
  469.                       selecta='Please select the page to send to your browser'
  470.                       angela=10
  471.                        do while angela~=0
  472.                          'request "'selecta'" "_Weekly Uploads|_Most downloaded|_Charts|_Exit"'
  473.                          angela=result
  474.                          if angela=1 then call sballa('yamexpansion:html/Weekly.'||daten||'.html')
  475.                          if angela=2 then call sballa('yamexpansion:html/MostDL.'||daten||'.html')
  476.                          if angela=3 then call sballa('yamexpansion:html/Charts.'||daten||'.html')
  477.                        end
  478.                       end
  479.      end
  480. end
  481.  
  482. statino=' Operation done, ready to serve you...'
  483. address YAMEXP text ID STATUS LABEL statino
  484.  
  485. return
  486.  
  487. sballa:
  488. parse arg chiama
  489.                                       /* Manda il file al browser */
  490.  
  491. if pos('VOYAGER',portazze)>0 then address 'VOYAGER' 'OpenURL file:///'|| chiama
  492.  
  493. if pos('IBROWSE',portazze)>0 then address 'IBROWSE' 'GotoURL file:///' || chiama
  494.  
  495. if pos('AWEB',portazze)>0 then do
  496.                                address value substr(portazze,pos('AWEB.',portazze),6)
  497.                                'Open file://localhost/' || chiama
  498.                                end
  499.  
  500. if pos('MINDWALKER',portazze)>0 then address 'MINDWALKER' 'OpenURL file:///'|| chiama
  501.  
  502. return
  503.  
  504.  
  505. creafile:                  /* Creazione del file */
  506. parse arg prex
  507.  
  508. getmailinfo sub
  509. nome=right(result,11)
  510. nome=strip(nome)
  511. daten=nome
  512. nome='yamexpansion:html/' || prex || nome || '.html'
  513. call open(filo,nome,'W')
  514.  
  515. return
  516.  
  517.  
  518. chiudihtml:                /* Chiusura dell'html */
  519. parse arg filoccioccio
  520.  
  521. writeln(filo,'<center>')
  522. writeln(filo,'<hr>')
  523. writeln(filo,'<h4>Send comments and whatever you want to: <B>Diego dx0 de Felice <a href="mailto:d.defelice@ba.nettuno.it">d.defelice@ba.nettuno.it</B></a>')
  524. writeln(filo,'</H4>')
  525. writeln(filo,'<h5>Created with YAM-Expansion v1.0 by <a href="mailto:d.defelice@ba.nettuno.it">Diego dx0 de Felice</a></h5>')
  526. writeln(filo,'</center>')
  527.  
  528. writeln(filo,'</body>')
  529. writeln(filo,'</html>')
  530. call close(filoccioccio)
  531.  
  532. return
  533.  
  534.  
  535. titola:                    /* Intestazione */
  536. parse arg subbo
  537.  
  538. writeln(filo,'<HTML>')
  539. writeln(filo,'<HEAD>')
  540. writeln(filo,'<!DOCTYPE HTML PUBLIC "-//IETF//DD HTML 3.0//EN">')
  541. writeln(filo,'<!-- AUTHOR="Diego dx0 de Felice" -->')
  542. writeln(filo,'<!-- EMAIL="d.defelice@ba.nettuno.it" -->')
  543. writeln(filo,'<!-- COMMENT="Made by YAM-Expansion for YAM (by Marcel Beck)." -->')
  544. writeln(filo,'<TITLE>'|| subbo ||'</TITLE>')
  545. writeln(filo,'</HEAD>')
  546. writeln(filo,'<BODY bgcolor="#FFFFFF">')
  547.  
  548. if subbo~='' then do                        /* Titolo del documento */
  549.                   writeln(filo,'<p>')
  550.                   writeln(filo,'<ul>')
  551.                   writeln(filo,'<H2><li><strong>'|| subbo ||'</strong></H2>')
  552.                   writeln(filo,'</ul></p>')
  553.                   subbo=''
  554.                   end
  555.  
  556. if flaggo=2 then  writeln(filo,'<center><h3> Most popular file on top</h3></center>')
  557.  
  558. return
  559.  
  560.  
  561. ilresto:                     /* Scrivacchia i messaggi dopo */
  562.  
  563. do until EOF(carmela)                       /* Se c'e' qualcosa dopo lo scrive */
  564.          lineazza=readln(carmela)
  565.  
  566.          if lineazza=msgday | lineazza=msgmir then
  567.  
  568.                   do                        /* Messages */
  569.                   writeln(filo,'<ul>')
  570.                   writeln(filo,'<H3><li><strong>'|| lineazza ||'</strong></H3>')
  571.                   writeln(filo,'</ul>')
  572.                   lineazza=readln(carmela)
  573.                   end
  574.  
  575.          writeln(filo,'<h5>'|| lineazza || '</H5>')
  576.          end
  577. return
  578.  
  579.  
  580. tavolozza:                                  /* Tavola */
  581. parse arg primas
  582.  
  583. writeln(filo,'<p>')
  584. writeln(filo,'<center><table border=3>')
  585. writeln(filo,'<TR>')                             /* prima riga standard */
  586. writeln(filo,'<th bgcolor="#ffff00"><h3>File</h3></th>')
  587. writeln(filo,'<th bgcolor="#ffff00"><h3>Dir</h3></th>')
  588. writeln(filo,'<th bgcolor="#ffff00"><h3>Size</h3></th>')
  589. if flaggo=2 then writeln(filo,'<th bgcolor="#ffff00"><h3>Age</h3></th>')
  590. writeln(filo,'<th bgcolor="#ffff00"><h3>Description</h3></th>')
  591. writeln(filo,'</TR>')
  592.  
  593. lineazza=readln(carmela)                    /* Salta l'intestazione */
  594.  
  595. do until lineazza=primas
  596.          lineazza=readln(carmela)
  597.          end
  598.  
  599. do until lineazza=''                        /* Corpo della tabella */
  600.          lineazza=readln(carmela)
  601.  
  602.          if lineazza='' then writeln(filo,'</table></center><h6></h6></p><br>') /* Fine tabella */
  603.  
  604.          sfile=substr(lineazza,1,18)
  605.          sfile=compress(sfile,' ')
  606.          sdir=substr(lineazza,20,10)
  607.          sdir=compress(sdir,' ')
  608.          ssize=substr(lineazza,31,4)
  609.          ssize=compress(ssize,' ')
  610.          sdescription=substr(lineazza,36,44)
  611.  
  612.          if flaggo=2 then do
  613.                           sage=substr(lineazza,36,3)
  614.                           sage=compress(sage,' ')
  615.                           sdescription=substr(lineazza,40,40)
  616.                           end
  617.  
  618.          linkolo=amineturl || aminetdir || sdir || '/' || sfile
  619.          ciccia=verify(sfile,'.','m')
  620.          leggilo=left(sfile,ciccia)
  621.          readmelo=amineturl || aminetdir || sdir || '/' || leggilo || 'readme'
  622.  
  623.          writeln(filo,'<tr>')
  624.          writeln(filo,'<td><h5><a href="'|| linkolo ||'">' || sfile || '</a></h5></td>')
  625.          writeln(filo,'<td><h5>' || sdir || '</h5></td>')
  626.          writeln(filo,'<td align=center><h5>' || ssize || '</h5></td>')
  627.          if flaggo=2 then writeln(filo,'<td align=center><h5>' || sage || '</h5></td>')
  628.          writeln(filo,'<td><h5><a href="'|| readmelo||'">' || sdescription || '</a></h5></td>')
  629.          writeln(filo,'</tr>')
  630.          end
  631. return
  632.  
  633.  
  634.  
  635. conamiga:
  636.  
  637. call open(amigascura,'yamexpansion:yamexp.config','R')
  638.  
  639. amineturl=readln(amigascura)
  640. aminetdir=readln(amigascura)
  641. sfeffeo=readln(amigascura)
  642. feffone=readln(amigascura)
  643. ftpmailurl=readln(amigascura)
  644. gaglioffo=readln(amigascura)
  645. seriaccio=readln(amigascura)
  646. ftpsitu=readln(amigascura)
  647. batchfile=readln(amigascura)
  648. baffone=readln(amigascura)
  649. pappone=readln(amigascura)
  650. ftpmailsites=readln(amigascura)
  651. aminethtmlsites=readln(amigascura)
  652. aminetftpsites=readln(amigascura)
  653.  
  654. call close(amigascura)
  655.  
  656. return
  657.  
  658.  
  659. salvaamiga:
  660.  
  661. call amigala
  662.  
  663. call open(amigascura,'yamexpansion:YamExp.config','W')
  664.  
  665. call writeln(amigascura,amineturl)
  666. call writeln(amigascura,aminetdir)
  667. call writeln(amigascura,sfeffeo)
  668. call writeln(amigascura,feffone)
  669. call writeln(amigascura,ftpmailurl)
  670. call writeln(amigascura,gaglioffo)
  671. call writeln(amigascura,seriaccio)
  672. call writeln(amigascura,ftpsitu)
  673. call writeln(amigascura,batchfile)
  674. call writeln(amigascura,baffone)
  675. call writeln(amigascura,pappone)
  676. call writeln(amigascura,ftpmailsites)
  677. call writeln(amigascura,aminethtmlsites)
  678. call writeln(amigascura,aminetftpsites)
  679.  
  680. call close(amigascura)
  681. return
  682.  
  683.  
  684. amigala:
  685.  
  686. poplist ID FTPLINK
  687. amineturl=result
  688. string ID DIRRA
  689. aminetdir=result
  690. check ID SWISI
  691. sfeffeo=result
  692. check ID SWIAM
  693. feffone=result
  694. poplist ID SFTP
  695. ftpmailurl=result
  696. popasl ID INFSIGN
  697. gaglioffo=result
  698. popasl ID SERSIGN
  699. seriaccio=result
  700. poplist ID FTPP
  701. ftpsitu=result
  702. popasl ID BACIO
  703. batchfile=result
  704. check ID FB
  705. baffone=result
  706. check ID ICOC
  707. pappone=result
  708.  
  709. return
  710.  
  711. /* --------------------- FTP SECTION -------------------------- */
  712.  
  713. winsozz:
  714.  
  715. address YAMEXP
  716.  
  717. window ID cicciotto TITLE "Ftp-Section" PORT YAMEXP
  718.  
  719.  group
  720.  
  721.   group HORIZ
  722.      label CENTER "Type:"
  723.      text ID TIPPO LABEL "domani"
  724.      label CENTER "Date:"
  725.      text ID DATTO LABEL "oggi"
  726.   endgroup
  727.  
  728.   group ID FFF FRAME LABELS "List of Files in the email"
  729.  
  730.   list ID ZAM COMMAND '"YAMEXP.rexx ADALL"' TITLE '"\033bFile,\033bDirectory,\033bSize,\033bAge,\033bDescription"' INSERT NODUP ATTRS Listview_DragType Listview_DragType_Immediate Listview_MultiSelect Listview_MultiSelect_Shifted MUIA_List_Format '"P=\033l BAR,P=\033l BAR,P=\033c BAR,P=\033c BAR,P=\033l"' HELP '"Select the files to include in the list below"'
  731.  
  732.     group HORIZ
  733.      label CENTER "Total Files in list:"
  734.      text ID SNFIFFI LABEL 0
  735.      label CENTER "Total Size (Bytes):"
  736.      text ID SNSIZZI LABEL 0
  737.     endgroup
  738.  
  739.   if tipox=1 then do
  740.                   group HORIZ
  741.                   button COMMAND '"YAMEXP.rexx WRL"' LABEL "Weekly Uploads"
  742.                   button COMMAND '"YAMEXP.rexx WMD"' LABEL "Most Downloaded"
  743.                   button COMMAND '"YAMEXP.rexx WCH"' LABEL "Aminet Chart"
  744.                   endgroup
  745.                   end
  746.  
  747.    button COMMAND '"YAMEXP.rexx ADALL"' LABEL "Add file(s) when the counters above have stopped"
  748.    endgroup
  749.    group FRAME LABELS "Selected Files"
  750.     list ID SELEN COMMAND '"YAMEXP.rexx RIMOZZO"' TITLE '"\033bFile,\033bDirectory,\033bSize,\033bAge,\033bDescription"' INSERT NODUP ATTRS Listview_DragType Listview_DragType_Immediate Listview_MultiSelect Listview_MultiSelect_Shifted MUIA_List_Format '"P=\033l BAR,P=\033l BAR,P=\033c BAR,P=\033c BAR,P=\033l"' HELP '"Selected files to include in the ftpmail"'
  751.  
  752.     group HORIZ
  753.      label CENTER "Selected Files:"
  754.      text ID NFIFFI LABEL 0
  755.      label CENTER "Total Size (Bytes):"
  756.      text ID NSIZZI LABEL 0
  757.     endgroup
  758.  
  759.     group HORIZ
  760.     button COMMAND '"YAMEXP.rexx MAKOZZO"' LABEL "Make FtpMail"
  761.     button COMMAND '"YAMEXP.rexx FOKOZZO"' LABEL "Make AmFtp Batch"
  762.     button COMMAND '"YAMEXP.rexx RIMOZZO"' HELP '"Remove selected files from list"' LABEL "Remove files"
  763.     button COMMAND '"YAMEXP.rexx XIXI"' HELP '"Exit NOW"' LABEL "Exit Now"
  764.     endgroup
  765.    endgroup
  766.  
  767.   if messalina=1 then view ID MESSO HELP '"Messages of the day and mirror status"' FILE "t:mess"
  768.  
  769.  endgroup
  770. endwindow
  771.  
  772. address YAMEXP method ID ZAM MUIM_List_Clear
  773.  
  774. return
  775.  
  776.  
  777.  
  778. removazzo:
  779. MUIV_List_Remove_Selected = -3
  780. List_Remove = 0x8042647e
  781. address YAMEXP method ID SELEN List_Remove MUIV_List_Remove_Selected
  782. address YAMEXP list ID SELEN MUIA_List_Entries
  783. diddio=result
  784. address YAMEXP text ID NFIFFI LABEL diddio
  785. sizzini=0
  786. do lilli=0 TO diddio
  787.    address YAMEXP list ID SELEN POS lilli
  788.    aca=result
  789.    aca=translate(aca,' ',',')
  790.    sdimension=word(aca,3)
  791.    call carla
  792.    sizzini=sizzini+sdimension
  793.    address YAMEXP text ID NSIZZI LABEL sizzini
  794. end
  795. return
  796.  
  797.  
  798. selezionazzi:
  799.  
  800. address YAMEXP text ID NFIFFI
  801. fiffini=result
  802. address YAMEXP text ID NSIZZI
  803. sizzini=result
  804.  
  805. do forever
  806.    address YAMEXP list ID ZAM
  807.    entrata=result
  808.  
  809.    if entrata='' then return
  810.  
  811.    aca=translate(entrata,' ',',')
  812.  
  813.    sdimension=word(aca,3)
  814.    call carla
  815.  
  816.    sizzini=sizzini+sdimension
  817.    address YAMEXP text ID NSIZZI LABEL sizzini
  818.  
  819.    fiffini=fiffini+1
  820.    address YAMEXP text ID NFIFFI LABEL fiffini
  821.  
  822.    address YAMEXP list ID SELEN INSERT POS MUIV_List_Insert_Bottom STRING entrata
  823. end
  824. return
  825.  
  826.  
  827. fokkolo:
  828.  
  829. statino=' Making batch file, please wait...'
  830. address YAMEXP text ID STATUS LABEL statino
  831.  
  832. popasl ID BACIO
  833. batchfile=result
  834. check ID FB
  835. baffone=result
  836.  
  837. address YAMEXP list ID SELEN MUIA_List_Entries
  838. quanti=result
  839.  
  840. address YAMEXP string ID DIRRA
  841. amidir=result
  842.  
  843. select
  844.       when baffone=1 then do
  845.                           if ~open(sfatti,batchfile,'A') then do
  846.                                                               call open(sfatti,batchfile,'W')
  847.                                                               end
  848.                           end
  849.       when baffone=0 then call open(sfatti,batchfile,'W')
  850. end
  851.  
  852. do lilli=0 TO quanti
  853.  
  854.    address YAMEXP list ID SELEN POS lilli
  855.    aca=result
  856.  
  857.    if aca='' then do
  858.                   call close(sfatti)
  859.                   statino=' Batch file created. Ready to serve you...'
  860.                   address YAMEXP text ID STATUS LABEL statino
  861.                   return
  862.                   end
  863.  
  864.    aca=translate(aca,' ',',')
  865.  
  866.    sdimension=word(aca,3)
  867.    call carla
  868.  
  869.    sfiletto=amidir||word(aca,2)||'/'word(aca,1)||'|'sdimension
  870.  
  871.    call writeln(sfatti,sfiletto)
  872. end
  873.  
  874. return
  875.  
  876.  
  877.  
  878. makkolo:
  879.  
  880. address YAMEXP list ID SELEN MUIA_List_Entries
  881. quanti=result
  882.  
  883. address YAMEXP string ID DIRRA
  884. amidir=result
  885.  
  886. call open(fatti,'t:ppp','W')
  887.  
  888. address YAMEXP poplist ID FTPP
  889. sytollo=result
  890.  
  891. connessozzo='connect' sytollo
  892.  
  893. call writeln(fatti,connessozzo)
  894. call writeln(fatti,'uuencode')
  895.  
  896. do lilli=0 TO quanti
  897.  
  898.    address YAMEXP list ID SELEN POS lilli
  899.    aca=result
  900.  
  901.    if aca='' then do
  902.                   call writeln(fatti,'quit')
  903.                   call close(fatti)
  904.  
  905.                   address 'YAM'
  906.  
  907.                   mailwrite
  908.  
  909.                   address YAMEXP poplist ID SFTP
  910.                   zftpmazzo=result
  911.  
  912.                   writemailto zftpmazzo
  913.  
  914.                   subbolo='"Aminet files"'
  915.  
  916.                   writesubject subbolo
  917.                   writeletter 't:ppp'
  918.                   writequeue
  919.                   address YAMEXP
  920.                   return
  921.                   end
  922.  
  923.    aca=translate(aca,' ',',')
  924.  
  925.    diritto='ls' amidir || word(aca,2)
  926.    filetto='get' word(aca,1)
  927.  
  928.    call writeln(fatti,diritto)
  929.    call writeln(fatti,filetto)
  930. end
  931.  
  932. return
  933.  
  934. /* Listatori */
  935.  
  936. ritodrl:
  937. address YAMEXP method ID ZAM MUIM_List_Clear
  938. address YAMEXP text ID TIPPO LABEL "This week's Aminet uploads"
  939. call open(ftodrl,'t:todrl','R')
  940. call rito
  941. call close(ftodrl)
  942. return
  943.  
  944. riwekmd:
  945. address YAMEXP method ID ZAM MUIM_List_Clear
  946. address YAMEXP text ID TIPPO LABEL "The most downloaded files from Aminet during the week"
  947. call open(ftodrl,'t:wekmd','R')
  948. call rito
  949. call close(ftodrl)
  950. return
  951.  
  952. riwekch:
  953. address YAMEXP method ID ZAM MUIM_List_Clear
  954. address YAMEXP text ID TIPPO LABEL "The highest rated programs during the week"
  955. call open(ftodrl,'t:wekch','R')
  956. call rito
  957. call close(ftodrl)
  958. return
  959.  
  960. rito:
  961. ciulone=0
  962. siulone=0
  963. do until EOF(ftodrl)
  964.    bazz=readln(ftodrl)
  965.    if ((bazz=',,,0,') | (bazz=',,,,')) then do
  966.                                             ciulone=ciulone-1
  967.                                             address YAMEXP text ID SNFIFFI LABEL ciulone
  968.                                             end
  969.                                        else do
  970.                                             aca=translate(bazz,' ',',')
  971.                                             sdimension=word(aca,3)
  972.                                             call carla
  973.                                             siulone=siulone+sdimension
  974.                                             address YAMEXP text ID SNSIZZI LABEL siulone
  975.  
  976.                                             ciulone=ciulone+1
  977.                                             address YAMEXP text ID SNFIFFI LABEL ciulone
  978.                                             address YAMEXP list ID ZAM INSERT POS MUIV_List_Insert_Bottom STRING bazz
  979.                                             end
  980. end
  981. return
  982.  
  983.  
  984. spezzettazza:
  985.  
  986. parse arg lines
  987.  
  988. prendimi=readln(carmelozza)
  989.  
  990. do until prendimi=lines
  991.          prendimi=readln(carmelozza)
  992.          end
  993.  
  994. do until lines=''
  995.          lines=readln(carmelozza)
  996.  
  997.          fsfile=substr(lines,1,18)
  998.          fsfile=compress(fsfile,' ')
  999.          fsdir=substr(lines,20,10)
  1000.          fsdir=compress(fsdir,' ')
  1001.  
  1002.          fssize=substr(lines,31,4)
  1003.  
  1004.          fssize=compress(fssize,' ')
  1005.          fsdescription=substr(lines,36,44)
  1006.  
  1007.          fsage=0
  1008.  
  1009.          if gibbo=1 then do
  1010.                          fsage=substr(lines,36,3)
  1011.                          fsage=compress(fsage,' ')
  1012.                          fsdescription=substr(lines,40,40)
  1013.                          end
  1014.  
  1015.          fsdescription=compress(fsdescription,',')
  1016.  
  1017.          bazz=fsfile || ',' || fsdir || ',' || fssize || ',' || fsage || ',' || fsdescription
  1018.          writeln(feffeo,bazz)
  1019.          end
  1020. return
  1021.  
  1022.  
  1023. faiftp:
  1024.  
  1025. address 'YAM'
  1026. show
  1027. getmailinfo from
  1028. vediamxo=compare(result,frommo)
  1029.  
  1030. if vediamxo~=0 then do
  1031.                     address YAM 'request "'error1'" "_Oh sorry"'
  1032.                     exit
  1033.                     end
  1034.  
  1035.                else do
  1036.                     statino=' Making archive list, please wait...'
  1037.                     address YAMEXP text ID STATUS LABEL statino
  1038.  
  1039.                     getmailinfo file
  1040.                     call open(carmelosa,result,'R')
  1041.                     call open(angelosa,'t:today','W')
  1042.  
  1043.                     do until EOF(carmelosa)
  1044.                        sxs=readln(carmelosa)
  1045.                        writeln(angelosa,sxs)
  1046.                        end
  1047.  
  1048.                     call close(angelosa)
  1049.                     call close(carmelosa)
  1050.  
  1051.                     messalina=0
  1052.                     getmailinfo sub
  1053.                     eccolo=result
  1054.                     nome=right(result,11)
  1055.                     nome=strip(nome)
  1056.                     daten=nome
  1057.  
  1058.                     if find(eccolo,giornal) then do
  1059.                                                  tipox=0
  1060.                                                  gibbo=0
  1061.                                                  call open(carmelozza,'t:today','R')
  1062.                                                  call open(feffeo,'t:todrl','W')
  1063.                                                  call spezzettazza(primadeifili)
  1064.                                                  call close(feffeo)
  1065.  
  1066.                                                   call open(feffeo,'t:mess','W')
  1067.                                                   do until EOF(carmelozza)
  1068.                                                      lizeazza=readln(carmelozza)
  1069.                                                      if lizeazza=msgday | lizeazza=msgmir then do
  1070.                                                                                                messalina=1
  1071.                                                                                                writeln(feffeo,lizeazza)
  1072.                                                                                                lizeazza=readln(carmelozza)
  1073.                                                                                                end
  1074.                                                      writeln(feffeo,lizeazza)
  1075.                                                      end
  1076.                                                   call close(feffeo)
  1077.                                                  call close(carmelozza)
  1078.  
  1079.                                                  call winsozz
  1080.                                                  address YAMEXP text ID TIPPO LABEL "Today's Aminet uploads"
  1081.                                                  address YAMEXP text ID DATTO LABEL daten
  1082.                                                  call open(ftodrl,'t:todrl','R')
  1083.                                                  call rito
  1084.                                                  call close(ftodrl)
  1085.                                                  end
  1086.  
  1087.                      if find(eccolo,settima) then do
  1088.                                                   tipox=1
  1089.                                                   call open(carmelozza,'t:today','R')
  1090.                                                   gibbo=0
  1091.                                                   call open(feffeo,'t:todrl','W')
  1092.                                                   call spezzettazza(primadeifili)
  1093.                                                   call close(feffeo)
  1094.  
  1095.                                                   gibbo=1
  1096.                                                   call open(feffeo,'t:wekmd','W')
  1097.                                                   call spezzettazza(primadeifilis)
  1098.                                                   call close(feffeo)
  1099.  
  1100.                                                   gibbo=1
  1101.                                                   call open(feffeo,'t:wekch','W')
  1102.                                                   call spezzettazza(primadeifilis)
  1103.                                                   call close(feffeo)
  1104.  
  1105.                                                   call open(feffeo,'t:mess','W')
  1106.                                                   do until EOF(carmelozza)
  1107.                                                      lizeazza=readln(carmelozza)
  1108.                                                      if lizeazza=msgday | lizeazza=msgmir then do
  1109.                                                                                                messalina=1
  1110.                                                                                                writeln(feffeo,lizeazza)
  1111.                                                                                                lizeazza=readln(carmelozza)
  1112.                                                                                                end
  1113.                                                      writeln(feffeo,lizeazza)
  1114.                                                      end
  1115.                                                   call close(feffeo)
  1116.  
  1117.                                                   call close(carmelozza)
  1118.                                                   call winsozz
  1119.                                                   address YAMEXP text ID TIPPO LABEL "This week's Aminet uploads"
  1120.                                                   address YAMEXP text ID DATTO LABEL daten
  1121.  
  1122.                                                   call open(ftodrl,'t:todrl','R')
  1123.                                                   call rito
  1124.                                                   call close(ftodrl)
  1125.                                                   end
  1126.  
  1127.                     statino=' Now you can select the archives...'
  1128.                     address YAMEXP text ID STATUS LABEL statino
  1129.                     end
  1130. return
  1131.  
  1132. carla:
  1133. select
  1134.   when pos('K',sdimension)>0 then do
  1135.                                   sdimension=strip(sdimension,,'K')
  1136.                                   sdimension=sdimension || '000'
  1137.                                   end
  1138.   when pos('M',sdimension)>0 then do
  1139.                                   sdimension=strip(sdimension,,'M')
  1140.                                   if pos('.',sdimension)>0 then do
  1141.                                                                 sdimension=compress(sdimension,'.')
  1142.                                                                 sdimension=sdimension || '00'
  1143.                                                                 end
  1144.                                                            else do
  1145.                                                                 sdimension=sdimension || '000'
  1146.                                                                 end
  1147.                                    sdimension=sdimension || '000'
  1148.                                    end
  1149.   otherwise sdimension=0
  1150. end
  1151. return
  1152.